<template>
  <div class="home">
    <!-- 头部 -->
    <!-- <div class="header">
      <img src="http://mall.newbee.ltd/mall/image/login-logo-2.png" alt="" />
      <div class="fr">
        <div class="search">
          <input class="text" type="text" autocomplete="off">
          <div class="search_hot"></div>
        </div>
        <div class="picture">
          <img src="http://mall.newbee.ltd/mall/image/search.png" alt="" />
        </div>
      </div>
    </div> -->
    <!-- 分类筛选 -->
    <div class="classify">
      <div class="category">
        <div class="category_bar">
          <div class="box1">
            <a href="##" @mouseover="showInfo" @mouseleave="hideInfo">家电</a>
            <div v-show="userInfo" class="box2">
              <a href="##">生活电器</a>
              <a href="##">厨房电器</a>
              <a href="##">扫地机器人</a>
              <a href="##">吸尘器</a>
              <a href="##">取暖器</a>
              <a href="##">豆浆机</a>
              <a href="##">暖风机</a>
              <a href="##">加湿器</a>
            </div>
            <div class="box3">
              <img src="http://mall.newbee.ltd/mall/image/right-@1x.png" alt="">
            </div>
            <div class="box4">"
              生活电器
              "
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 排序 -->
    <div class="sort">
      <div class="list">
        <a href="#">
          <div class="active">推荐</div>
        </a>
        <a href="#">
          <div>新品</div>
        </a>
        <a href="#">
          <div>价格</div>
        </a>
      </div>

      <div class="goods_item center">
        <div class="main center">
          <div class="item_card_frame">
            <div class="item_card"><a href="/goods/detail/10158" target="_blank"><img
                  src="	http://mall.newbee.ltd/goods-img/5488564b-8335-4b0c-a5a4-52f3f03ee728.jpg"
                  alt="无印良品 女式粗棉线条纹长袖T恤"></a></div>
            <div class="item_brand"><a href="/goods/detail/10158" target="_blank">无印良品 女式粗棉线条纹长袖T恤</a></div>
            <div class="item_sub_intro">黑*横条 L</div>
            <div class="item_price">70.00元</div>
          </div>

          <div class="item_card_frame">
            <div class="item_card"><a href="/goods/detail/10195" target="_blank"><img
                  src="		http://mall.newbee.ltd/goods-img/0dc503b2-90a2-4971-9723-c085a1844b76.jpg"
                  alt="索尼 WH-1000XM3 头戴式耳机"></a></div>
            <div class="item_brand"><a href="/goods/detail/10195" target="_blank">索尼 WH-1000XM3 头戴式耳机</a></div>
            <div class="item_sub_intro">高解析度无线蓝牙降噪（触控面板 智能降噪 长久续航）黑色</div>
            <div class="item_price">2599.00元</div>
          </div>

          <div class="item_card_frame">
            <div class="item_card"><a href="/goods/detail/10802" target="_blank"><img
                  src="	http://mall.newbee.ltd/goods-img/92beacb0-f692-42ff-a20f-8fecd2b0c046.jpg"
                  alt="Redmi Note7 4800万双摄千元机 满血骁龙6..."></a>
            </div>
            <div class="item_brand"><a href="/goods/detail/10802" target="_blank">Redmi Note7 4800万双摄千元机 满血骁龙6...</a>
            </div>
            <div class="item_sub_intro">18个月超长质保 4000mAh超长续航 6GB+64GB ...</div>
            <div class="item_price">1099.00元</div>
          </div>
          <div class="clear"></div>
        </div>
        <div class="pages">
          <div class="page_wrap">
            <span class="page_span1">
              <a href="##">上一页 </a>
              <a href="##" class="active">1</a>
              <a href="##">下一页</a>
            </span>
          </div>
        </div>
      </div>

    </div>
  </div>
</template>

<script >
export default {
  data() {
    return {
      userInfo: false,
    }
  },
  methods: {
    hideInfo() {
      setTimeout(() => {
        this.userInfo = false
      }, 0)
    },
    showInfo() {
      this.userInfo = true
    },
  }
} 
</script>


<style lang="scss" scoped>
* {
  padding: 0;
  margin: 0;
  display: block;
}

.home {
  width: 100%;
  margin: 0 auto;

  // 头部
  .header {
    width: 1226px;
    height: 100px;
    margin-left: 0;
    margin: 0 auto;
    display: flex;

    img {
      width: 240px;
      height: 100px;
    }

    .fr {
      position: relative;
      display: flex;
      justify-content: flex-end;
      align-items: center;
      height: 100%;
      flex-grow: 1;

      .search {
        .text {
          box-sizing: border-box;
          width: 250px;
          height: 50px;
          border: 1px solid #ccc;
          padding: 0 10px;
        }

        .search_hot {
          position: absolute;
          top: 16px;
          right: 12px;
        }
      }

      .picture {
        img {
          box-sizing: border-box;
          width: 50px;
          height: 50px;
          background-color: #fff;
          border: 1px solid #ccc;
        }
      }
    }
  }

  // 分类筛选
  .classify {
    height: 24px;
    width: 100%;
    display: flex;

    .category {
      width: 1210px;
      margin: 0 auto 15px;

      .category_bar {
        height: 24px;
        line-height: 24px;

        .box1 {
          position: relative;
          float: left;
          margin-right: 5px;
          width: 42px;
          height: 24px;
          background-color: #1baeae;

          a {
            display: inline-block;
            height: 22px;
            // padding: 0 4px 0 8px;
            border: 1px solid #ddd;
            line-height: 22px;
            vertical-align: top;
            font-size: 14px;
            position: relative;
            text-decoration: none;
            background: #fff;
          }

          .box1.box2 {
            top: 23px;
            left: 0;
            width: 400px;
            padding: 10px 0;
            border: 1px solid #1baeae;
            background: #fff;
            z-index: 20;
            display: none;

            .userMessage {
              &:hover {
                cursor: pointer;
              }
            }

            .box1.box2 a {
              border: 0;
              display: block;
              float: left;
              margin-right: 5px;
              text-decoration: none;
              background: #fff;

              &:hover {
                cursor: pointer;
              }
            }
          }

          .box1.box3 {
            float: left;
            margin-right: 5px;

            img {
              border: none;
              max-width: 100%;
              max-height: 100%;
            }
          }

          .box1.box4 {
            font-weight: bold;
            color: #666;
            font-size: 15px;
          }
        }
      }
    }
  }

  // 排序
  .sort {
    width: 100%;
    height: 81px;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;

    .list {
      width: 1226px;
      height: 81px;
      margin: 0 auto;
      display: flex;
      align-items: center;
      font-size: 14px;

      a {
        border: none;
        text-decoration: none;
        color: #000;
      }

      div {
        height: 20px;
        line-height: 20px;
        padding: 0 30px;
        cursor: pointer;
        transition: color 0.2s;
      }

      div:nth-child(1) {
        text-align: left;
        padding-left: 0;
        border-left: 0;
      }

      .active {
        color: #1baeae;
      }
    }

    .center {
      margin: 0 auto;

      .main {
        width: 1226px;

        .item_card_frame {
          float: left;
          width: 230px;
          height: 339px;
          background: #fafafa;
          cursor: pointer;
          margin-bottom: 16px;
          margin-top: 4px;
          margin-left: 2px;

          .item_card {
            padding: 37px;

            a {
              border: none;
              text-decoration: none;
              color: #000;

              a img {
                display: block;
                width: 160px;
                height: 160px;
                opacity: 0.85;
              }
            }

            img {
              border: none;
              max-width: 100%;
              max-height: 100%;
            }
          }

          .item_brand {
            width: 226px;
            height: 14px;
            line-height: 14px;
            text-align: center;
            margin-top: -10px;

            a {
              font-size: 14px;
              color: #333;
              padding: 0 8px 0 8px;
            }
          }

          .item_sub_intro {
            width: 208px;
            height: 14px;
            line-height: 14px;
            margin: 18px 0;
            font-size: 12px;
            color: #b0b0b0;
            text-align: center;
            padding: 0 8px 0 8px;
          }

          .item_price {
            font-size: 14px;
            text-align: center;
            color: #1baeae;
          }
        }
        .clear{
          clear: both;
        }
      }

      // 调页
      .pages {
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 35px 0 20px;
        width: 100%;
        height: 50px;

        .page_wrap {
          width: 1226px;

          .page_span1 {
            float: right;

            a {
              font-size: 14px;
              display: block;
              float: left;
              text-decoration: none;
              height: 36px;
              background: #f0f0f0;
              line-height: 36px;
              padding: 0 14px;
              margin-right: 5px;
              border: 1px solid #ddd;
            }

            a:nth-child(1) {
              color: #ccc;
              background: #fff;
            }

            .active {
              border: 0;
              color: #1baeae;
              background: #fff;
            }
          }
        }
      }
    }
  }
}
</style>
